/*使用如下，参数为表格table的id,确认选项事件id，展示面板id,不用#
chooseItemShow(tableId,ensureId,storeContentId)

*/

var $table,$button,$content;
function chooseItemShow(tableId,ensureId,storeContentId){
    $table = $('#'+tableId);
    $button = $('#'+ensureId);
    $content=$("#"+storeContentId);
	var listData;
	var listLen;
	$(function () {
	$button.click(function () {
		$("#"+storeContentId).empty();
	    listData=$table.bootstrapTable('getSelections');
	    listLen=listData.length;
	    if(listLen!=0){
	    	for(var i=0;i<listLen;i++){
	    		var session="<div class='selectItem'>"+"<span class='mainWord'>"+listData[i].goodsCategory+"</span>"+"<i class='fa fa-close text-red' onclick='deleteItem(this,"+listData[i].index+")'></i>"+"</div>";
	        	$("#"+storeContentId).append(session);
	        }
	    }
	    
	});
	});

}
function deleteItem(target,index){
	$table.bootstrapTable('uncheck',index-1);
	$(target).parent().remove();
}